﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using DotNet.Auth.Service;
using DotNet.Auth.Utility;
using DotNet.Web.Areas.AuthWeb.Controllers;
using DotNet.Helper;
using DotNet.JCore.Entity;
using DotNet.JCore.Service;
using DotNet.Extensions;

namespace DotNet.Web.Areas.Mobile.Controllers
{
    public class M_SystemRegController : M_BaseController
    {
        private SystemRegService service = new SystemRegService();
        public ActionResult Index()
        {
            var startDate = AuthService.Param.Get("SearchStartDate", "10");
            ViewBag.StartDate = System.DateTime.Now.AddDays(-Convert.ToInt32(startDate)).ToString("yyyy-MM-dd");
            var currentUser = AuthHelper.GetSessionUser();
            if (!currentUser.IsAdmin)
            {
                ViewBag.pointId = CurrentEmployee.PointId;
            }
            return View();
        }

        public ActionResult Grid(string CarNO, string startDate)
        {
            var list = service.GetAllList(CarNO, startDate.ToDateTimeOrNull());
            return View(list);
        }

        public ActionResult Search()
        {
            return View();
        }
    }
}